package cn.liberals.controller;

import cn.liberals.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    //加载端口
    @Value("${server.port}")
    private int port;

    @GetMapping("/getUserById/{id}")
    public User getUserById(@PathVariable Long id){ //通过id  到数据库查询指定的用户的信息
        System.out.println(port);
        return User.builder().id(id).username("zs").intro("我是zs"+port).build();
    }

}
